/**
 * 
 */
package de.oszimtcc.timetableservices;

import java.util.Random;

import android.app.NotificationManager;
import android.content.Context;
import android.util.Log;
import de.oszimtcc.framework.Logger;
import de.oszimtcc.timetable.TimetableApplication;


/**
 * @author reuter
 *
 */
public class NotificationHandler
{
	NotificationManager manager = (NotificationManager)TimetableApplication.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);

	public NotificationHandler()
	{
		Thread notificationThread = new Thread(notificationService,"notificationService");
		notificationThread.start();
	}
	
	private Runnable notificationService = new Runnable()
	{	
		@Override
		public void run()
		{
			while(true)
			{
				Random rand = new Random();
				try
                {
					Logger.Debug("sleep");
	                Thread.sleep(((rand.nextInt(5)+5)*1000));
                }
                catch(InterruptedException e)
                {
                	Logger.Error("NotificationThread Exception : " + e);
                }
                //new Notifications(TimetableApplication.getInstance().getContext()).setAlarmManager();
                Logger.Debug("new Notification");
			}
		}
	};
}
